var $parentNode = window.parent.document;

function $childNode(name) {
    return window.frames[name]
}

$('.tooltip-demo').tooltip({selector: "[data-toggle=tooltip]", container: "body"});
$('.modal').appendTo("body");
$('.collapse-link').click(function () {
    var ibox = $(this).closest('div.ibox');
    var button = $(this).find('i');
    var content = ibox.find('div.ibox-content');
    content.slideToggle(200);
    button.toggleClass('fa-chevron-up').toggleClass('fa-chevron-down');
    ibox.toggleClass('').toggleClass('border-bottom');
    setTimeout(function () {
        ibox.resize();
        ibox.find('[id^=map-]').resize()
    }, 50)
});
$('.close-link').click(function () {
    var content = $(this).closest('div.ibox');
    content.remove()
});
// if (top == this) {
//     var gohome = '<div class="gohome"><a class="animated bounceInUp" href="' + Feng.ctxPath + '/login" title="返回首页"><i class="fa fa-home"></i></a></div>';
//     $('body').append(gohome)
// }

function animationHover(element, animation) {
    element = $(element);
    element.hover(function () {
        element.addClass('animated ' + animation)
    }, function () {
        window.setTimeout(function () {
            element.removeClass('animated ' + animation)
        }, 2000)
    })
}

function WinMove() {
    var element = "[class*=col]";
    var handle = ".ibox-title";
    var connect = "[class*=col]";
    $(element).sortable({
        handle: handle,
        connectWith: connect,
        tolerance: 'pointer',
        forcePlaceholderSize: true,
        opacity: 0.8,
    }).disableSelection()
};